//
//  BACollectionReusableView.m
//  HappyBaby
//
//  Created by lanou on 15/11/24.
//  Copyright © 2015年 华哥. All rights reserved.
//

#import "BACollectionReusableView.h"

#import "Define.h"
#import "UIImageView+WebCache.h"

@interface BACollectionReusableView ()
@property(nonatomic,retain)UIImageView *picImageView;
@property(nonatomic,retain)UILabel *textLabel;

@end
@implementation BACollectionReusableView
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.picImageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 10, 20, 20)];
        //self.picImageView.backgroundColor = [UIColor yellowColor];
        [self addSubview:self.picImageView];
        
        self.textLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 10, 80, 20)];
        //self.textLabel.backgroundColor = [UIColor grayColor];
        [self addSubview:self.textLabel];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setTitle:@"更多" forState:UIControlStateNormal];
        button.titleLabel.font = [UIFont boldSystemFontOfSize:15];
        [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        button.frame = CGRectMake(kScreenWidth-5-60, 10, 40, 20);
        [self addSubview:button];
        self.moreBtn = button;
        
        UIImageView *myImgaeView = [[UIImageView alloc]initWithFrame:CGRectMake(button.frame.origin.x + 40, 10, 20, 20)];
        myImgaeView.image = [UIImage imageNamed:@"1.png"];
        [self addSubview:myImgaeView];
    }
    
    return self;
    
}

- (void)setModel:(TwoModel *)model
{
    _model = model;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    self.textLabel.text = model.title;
    
    
}

@end
